<?php
	function writeLog($logfile = '', $str='', $type='return',$tip='') {
	$root='tmp/';
	$write_type = "ab";
	$log_file = $root . $logfile;
	$notes = '';
	$notes .= date('Y-m-d H:i:s')."    ".$type."    ".$tip."\n";
	$notes .= $str . "\n\n\n";
	if ($handle = fopen($log_file, $write_type)) {
		fwrite($handle, $notes);
		fclose($handle);
	}
}
writeLog('test.txt',json_encode($_POST));
?>
